package edu.usc.csci578.model;

import java.util.*;

public class STopic {
	public static final boolean TOPIC_TYPE_SPEC = true;
	public static final boolean TOPIC_TYPE_INDEP = false;
	public static final String XML_TAG_SPEC = "spec";
	public static final String XML_TAG_INDEP = "indep";
	public static final String XML_TAG_UNSPEC = "unspec";

	private int id;
	private boolean type;
	private List<String> words;

	public STopic(int id) {
		super();
		this.id = id;
		this.words = new LinkedList<String>();
	}
	
	public STopic(int id, boolean type, List<String> words) {
		super();
		this.id = id;
		this.type = type;
		this.words = words;
	}

	public int getId() {
		return id;
	}

	public boolean isSpec() {
		return type;
	}

	public boolean isIndep() {
		return !type;
	}

	public List<String> getWords() {
		return words;
	}
	
	public void setType(boolean type) {
		this.type=type;
	}
	
	public void setWords(List<String> words) {
		this.words=words;
	}
	
	public String toString() {
		StringBuffer output = new StringBuffer();
		output.append("Topic Id ");
		output.append(id);
		output.append("\n");
		output.append("Type: ");
		output.append(type);
		output.append("\nWords: ");
		for (String word : words) {
			output.append(word);
			output.append(",");
		}
		return output.toString();
	}
}
